package transportadora;

import java.sql.*;


public class BDConnection {
    
    public static Connection connectLH() throws ClassNotFoundException, SQLException {

        Class.forName("oracle.jdbc.driver.OracleDriver");
		String url = "jdbc:oracle:thin:@//172.16.250.130:1521/XE";

		Connection connection =
			DriverManager.getConnection(url,"bdproj","bdproj");

		
                return connection;

    }


    public static Connection connectDI() throws ClassNotFoundException, SQLException {
        
        Class.forName("oracle.jdbc.driver.OracleDriver");
		String url = "jdbc:oracle:thin:@//193.136.19.64:1521/OSIRIS";

		Connection connection =
			DriverManager.getConnection(url,"A54770","a54770");

                return connection;
    }

    public static Boolean isOpen(Connection c) throws ClassNotFoundException,SQLException {

        if(c.isClosed()) {
            return false;
        }
        else {
            return true;
        }
    }

}